home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / C Internet Config / IC Application Source ƒ / C Source ƒ / OS Subs.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-11-28  |  592 b   |  35 lines  |  [TEXT/SPM ]

  1. /*
  2.     OS Subs.c
  3.     
  4. */
  5.  
  6. #include "OS Subs.h"
  7.  
  8. short NumToolboxTraps(void){
  9.     if (NGetTrapAddress(_InitGraf,ToolTrap)==NGetTrapAddress(0xaa6e,ToolTrap))
  10.         return 0x0200;
  11.     return 0x0400;
  12. }
  13.  
  14.  
  15. TrapType GetTrapType(short theTrap){
  16. #define TrapMask 0x0800
  17.     
  18.     if (theTrap&TrapMask)
  19.         return ToolTrap;
  20.     return OSTrap;
  21. }
  22.  
  23. Boolean OurTrapAvailable(short theTrap){
  24.     TrapType tType;
  25.     
  26.     tType=GetTrapType(theTrap);
  27.     if (tType==ToolTrap){
  28.         theTrap &= 0x07ff;
  29.         if (theTrap>NumToolboxTraps())
  30.             theTrap=_Unimplemented;
  31.     }
  32.     
  33.     return (NGetTrapAddress(theTrap,tType)!=NGetTrapAddress(_Unimplemented,ToolTrap));
  34. }
  35.